import 'package:flutter/cupertino.dart';import 'package:flutter/material.dart';class CustomTextField extends StatefulWidget{  Function callback;  InputDecoration inputDecoration;  CustomTextField(this.callback,this.inputDecoration);  @override  State<StatefulWidget> createState() {    // TODO: implement createState    return CustomTextFieldState();  }}class CustomTextFieldState extends State<CustomTextField> with AutomaticKeepAliveClientMixin  {//关键代码：AutomaticKeepAliveClientMixin保存状态  @override  bool get wantKeepAlive => true; //关键代码：重写get wantKeepAlive并设置为true  @override  void initState() {    // TODO: implement initState    super.initState();  }  @override  Widget build(BuildContext context)  {    return TextField(      decoration: widget.inputDecoration,      onChanged: (value){        widget.callback(value);      },    );  }}